home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / os2 / adaptor.zip / ADAPT.ZIP / adaptor / src / indexsha.c < prev    next >
Text File  |  1994-01-03  |  17KB  |  796 lines

  1. # include "IndexSha.h"
  2. # include "yyIShape.w"
  3. # include <stdio.h>
  4. # if defined __STDC__ | defined __cplusplus
  5. #  include <stdlib.h>
  6. # else
  7.    extern void exit ();
  8. # endif
  9. # include "Tree.h"
  10. # include "Definiti.h"
  11.  
  12. # ifndef NULL
  13. # define NULL 0L
  14. # endif
  15. # ifndef false
  16. # define false 0
  17. # endif
  18. # ifndef true
  19. # define true 1
  20. # endif
  21.  
  22. # ifdef yyInline
  23. # define yyALLOC(tree, free, max, alloc, nodesize, make, ptr, kind) \
  24.   if ((ptr = (tree) free) >= (tree) max) ptr = alloc (); \
  25.   free += nodesize [kind]; \
  26.   ptr->yyHead.yyMark = 0; \
  27.   ptr->Kind = kind;
  28. # else
  29. # define yyALLOC(tree, free, max, alloc, nodesize, make, ptr, kind) ptr = make (kind);
  30. # endif
  31.  
  32. # define yyWrite(s) (void) fputs (s, yyf)
  33. # define yyWriteNl (void) fputc ('\n', yyf)
  34.  
  35. # line 48 "IndexShapes.puma"
  36.  
  37. # include <stdio.h>
  38. # include "Idents.h"
  39. # include "StringMe.h"
  40. # include "protocol.h"
  41.  
  42. # include "Expressi.h"    /* AddConstant */
  43.  
  44. # include "Shapes.h"
  45.  
  46.  
  47. static FILE * yyf = stdout;
  48.  
  49. static void yyAbort
  50. # ifdef __cplusplus
  51.  (char * yyFunction)
  52. # else
  53.  (yyFunction) char * yyFunction;
  54. # endif
  55. {
  56.  (void) fprintf (stderr, "Error: module IndexShapes, routine %s failed\n", yyFunction);
  57.  exit (1);
  58. }
  59.  
  60. tTree FindShapeExp ARGS((tTree actual, tTree fstart, tTree fstop, tTree finc, tTree exp));
  61. static tTree IndexSub ARGS((tTree exp, tTree sub));
  62. static tTree IndexAdd ARGS((tTree exp, tTree add));
  63. static tTree IndexDivMult ARGS((tTree exp, tTree divisor, tTree mult));
  64. static tTree ConstIndexDivMult ARGS((tTree exp, int divisor, int mult));
  65. static tTree MultConstant ARGS((tTree exp, int c));
  66. static tTree DivConstant ARGS((tTree exp, int c));
  67. static tTree MinusExpression ARGS((tTree exp));
  68. static void GetIncrement ARGS((tTree inc, bool * found, int * val));
  69. static bool IsOneIncrement ARGS((tTree t));
  70. tTree NormalArrayIndexes ARGS((tTree t));
  71.  
  72. tTree FindShapeExp
  73. # if defined __STDC__ | defined __cplusplus
  74. (register tTree actual, register tTree fstart, register tTree fstop, register tTree finc, register tTree exp)
  75. # else
  76. (actual, fstart, fstop, finc, exp)
  77.  register tTree actual;
  78.  register tTree fstart;
  79.  register tTree fstop;
  80.  register tTree finc;
  81.  register tTree exp;
  82. # endif
  83. {
  84.   if (actual->Kind == kSLICE_EXP) {
  85. # line 94 "IndexShapes.puma"
  86.  {
  87.   tTree newexp;
  88.   {
  89. # line 96 "IndexShapes.puma"
  90.  
  91. # line 98 "IndexShapes.puma"
  92.  
  93.  
  94.      newexp = exp;
  95.  
  96.      newexp = IndexSub (newexp, fstart);
  97.  
  98.      newexp = IndexDivMult (newexp, finc, actual->SLICE_EXP.INC);
  99.  
  100.      newexp = IndexAdd (newexp, actual->SLICE_EXP.START);
  101.  
  102.  
  103.   }
  104.   {
  105.    return newexp;
  106.   }
  107.  }
  108.  
  109.   }
  110.  yyAbort ("FindShapeExp");
  111. }
  112.  
  113. static tTree IndexSub
  114. # if defined __STDC__ | defined __cplusplus
  115. (register tTree exp, register tTree sub)
  116. # else
  117. (exp, sub)
  118.  register tTree exp;
  119.  register tTree sub;
  120. # endif
  121. {
  122. # line 121 "IndexShapes.puma"
  123.  
  124. bool found;
  125. int  val;
  126.  
  127. # line 126 "IndexShapes.puma"
  128.   {
  129. # line 127 "IndexShapes.puma"
  130.    GetIntConstValue (sub, & found, & val);
  131. # line 128 "IndexShapes.puma"
  132.    if (! ((found == true))) goto yyL1;
  133.   }
  134.    return AddConstant (exp, - val);
  135. yyL1:;
  136.  
  137. # line 132 "IndexShapes.puma"
  138.    return mOP_EXP (mOP_MINUS (), exp, sub);
  139.  
  140. }
  141.  
  142. static tTree IndexAdd
  143. # if defined __STDC__ | defined __cplusplus
  144. (register tTree exp, register tTree add)
  145. # else
  146. (exp, add)
  147.  register tTree exp;
  148.  register tTree add;
  149. # endif
  150. {
  151. # line 157 "IndexShapes.puma"
  152.  
  153. bool found;
  154. int  val;
  155.  
  156. # line 162 "IndexShapes.puma"
  157.   {
  158. # line 163 "IndexShapes.puma"
  159.    GetIntConstValue (add, & found, & val);
  160. # line 164 "IndexShapes.puma"
  161.    if (! ((found == true))) goto yyL1;
  162.   }
  163.    return AddConstant (exp, val);
  164. yyL1:;
  165.  
  166.   if (exp->Kind == kOP_EXP) {
  167.   if (exp->OP_EXP.EXP_OP->Kind == kOP_MINUS) {
  168. # line 168 "IndexShapes.puma"
  169.   {
  170. # line 169 "IndexShapes.puma"
  171.    GetConstDifference (add, exp->OP_EXP.OPND2, & found, & val);
  172. # line 170 "IndexShapes.puma"
  173.    if (! ((found == true))) goto yyL2;
  174.   }
  175.    return AddConstant (exp->OP_EXP.OPND1, val);
  176. yyL2:;
  177.  
  178. # line 174 "IndexShapes.puma"
  179.   {
  180. # line 175 "IndexShapes.puma"
  181.    GetIntConstValue (exp->OP_EXP.OPND2, & found, & val);
  182. # line 176 "IndexShapes.puma"
  183.    if (! ((found == true))) goto yyL3;
  184.   }
  185.    return IndexAdd (exp->OP_EXP.OPND1, AddConstant (add, - val));
  186. yyL3:;
  187.  
  188.   }
  189.   if (exp->OP_EXP.EXP_OP->Kind == kOP_PLUS) {
  190. # line 180 "IndexShapes.puma"
  191.   {
  192. # line 181 "IndexShapes.puma"
  193.    GetIntConstValue (exp->OP_EXP.OPND2, & found, & val);
  194. # line 182 "IndexShapes.puma"
  195.    if (! ((found == true))) goto yyL4;
  196.   }
  197.    return IndexAdd (exp->OP_EXP.OPND1, AddConstant (add, val));
  198. yyL4:;
  199.  
  200.   }
  201.   }
  202. # line 186 "IndexShapes.puma"
  203.    return mOP_EXP (mOP_PLUS (), exp, add);
  204.  
  205. }
  206.  
  207. static tTree IndexDivMult
  208. # if defined __STDC__ | defined __cplusplus
  209. (register tTree exp, register tTree divisor, register tTree mult)
  210. # else
  211. (exp, divisor, mult)
  212.  register tTree exp;
  213.  register tTree divisor;
  214.  register tTree mult;
  215. # endif
  216. {
  217. # line 202 "IndexShapes.puma"
  218.  {
  219.   bool yyV1;
  220.   int yyV2;
  221.   bool yyV3;
  222.   int yyV4;
  223.   {
  224. # line 203 "IndexShapes.puma"
  225.    GetIncrement (divisor, & yyV1, & yyV2);
  226. # line 204 "IndexShapes.puma"
  227.    if (! ((yyV1 == true))) goto yyL1;
  228.   {
  229. # line 205 "IndexShapes.puma"
  230.    GetIncrement (mult, & yyV3, & yyV4);
  231. # line 206 "IndexShapes.puma"
  232.    if (! ((yyV3 == true))) goto yyL1;
  233.   }
  234.   }
  235.   {
  236.    return ConstIndexDivMult (exp, yyV2, yyV4);
  237.   }
  238.  }
  239. yyL1:;
  240.  
  241. # line 212 "IndexShapes.puma"
  242.   {
  243. # line 213 "IndexShapes.puma"
  244.    if (! ((EqualExpression (divisor, mult) == true))) goto yyL2;
  245.   }
  246.    return exp;
  247. yyL2:;
  248.  
  249. # line 220 "IndexShapes.puma"
  250.  {
  251.   bool yyV1;
  252.   int yyV2;
  253.   {
  254. # line 221 "IndexShapes.puma"
  255.    GetIncrement (divisor, & yyV1, & yyV2);
  256. # line 222 "IndexShapes.puma"
  257.    if (! ((yyV1 == true))) goto yyL3;
  258.   {
  259. # line 223 "IndexShapes.puma"
  260.    if (! ((yyV2 == 1))) goto yyL3;
  261.   }
  262.   }
  263.   {
  264.    return mOP_EXP (mOP_TIMES (), exp, mult);
  265.   }
  266.  }
  267. yyL3:;
  268.  
  269. # line 227 "IndexShapes.puma"
  270.  {
  271.   bool yyV1;
  272.   int yyV2;
  273.   {
  274. # line 228 "IndexShapes.puma"
  275.    GetIncrement (mult, & yyV1, & yyV2);
  276. # line 229 "IndexShapes.puma"
  277.    if (! ((yyV1 == true))) goto yyL4;
  278.   {
  279. # line 230 "IndexShapes.puma"
  280.    if (! ((yyV2 == 1))) goto yyL4;
  281.   }
  282.   }
  283.   {
  284.    return mOP_EXP (mOP_DIVIDE (), exp, divisor);
  285.   }
  286.  }
  287. yyL4:;
  288.  
  289. # line 234 "IndexShapes.puma"
  290.    return mOP_EXP (mOP_TIMES (), mOP_EXP (mOP_DIVIDE (), exp, divisor), mult);
  291.  
  292. }
  293.  
  294. static tTree ConstIndexDivMult
  295. # if defined __STDC__ | defined __cplusplus
  296. (register tTree exp, register int divisor, register int mult)
  297. # else
  298. (exp, divisor, mult)
  299.  register tTree exp;
  300.  register int divisor;
  301.  register int mult;
  302. # endif
  303. {
  304. # line 242 "IndexShapes.puma"
  305.   {
  306. # line 243 "IndexShapes.puma"
  307.    if (! (((mult % divisor) == 0))) goto yyL1;
  308.   }
  309.    return MultConstant (exp, mult / divisor);
  310. yyL1:;
  311.  
  312. # line 247 "IndexShapes.puma"
  313.   {
  314. # line 248 "IndexShapes.puma"
  315.    if (! (((divisor % mult) == 0))) goto yyL2;
  316.   }
  317.    return DivConstant (exp, divisor / mult);
  318. yyL2:;
  319.  
  320. # line 254 "IndexShapes.puma"
  321.    return MultConstant (DivConstant (exp, divisor), mult);
  322.  
  323. }
  324.  
  325. static tTree MultConstant
  326. # if defined __STDC__ | defined __cplusplus
  327. (register tTree exp, register int c)
  328. # else
  329. (exp, c)
  330.  register tTree exp;
  331.  register int c;
  332. # endif
  333. {
  334. # line 266 "IndexShapes.puma"
  335.  
  336. bool found;
  337. int  val;
  338.  
  339.   if (equalint (c, 0)) {
  340. # line 271 "IndexShapes.puma"
  341.    return MakeConstant (0);
  342.  
  343.   }
  344.   if (equalint (c, 1)) {
  345. # line 275 "IndexShapes.puma"
  346.    return exp;
  347.  
  348.   }
  349. # line 279 "IndexShapes.puma"
  350.   {
  351. # line 280 "IndexShapes.puma"
  352.    if (! ((c < 0))) goto yyL3;
  353.   }
  354.    return MinusExpression (MultConstant (exp, - c));
  355. yyL3:;
  356.  
  357. # line 284 "IndexShapes.puma"
  358.   {
  359. # line 285 "IndexShapes.puma"
  360.    GetIntConstValue (exp, & found, & val);
  361. # line 286 "IndexShapes.puma"
  362.    if (! (found == true)) goto yyL4;
  363.   }
  364.    return MakeConstant (c * val);
  365. yyL4:;
  366.  
  367.   if (exp->Kind == kOP_EXP) {
  368.   if (exp->OP_EXP.EXP_OP->Kind == kOP_PLUS) {
  369. # line 290 "IndexShapes.puma"
  370.   {
  371. # line 291 "IndexShapes.puma"
  372.  exp->OP_EXP.OPND1 = MultConstant (exp->OP_EXP.OPND1, c);
  373.      exp->OP_EXP.OPND2 = MultConstant (exp->OP_EXP.OPND2, c);
  374.  
  375.   }
  376.    return exp;
  377.  
  378.   }
  379.   if (exp->OP_EXP.EXP_OP->Kind == kOP_MINUS) {
  380. # line 297 "IndexShapes.puma"
  381.   {
  382. # line 298 "IndexShapes.puma"
  383.  exp->OP_EXP.OPND1 = MultConstant (exp->OP_EXP.OPND1, c);
  384.      exp->OP_EXP.OPND2 = MultConstant (exp->OP_EXP.OPND2, c);
  385.  
  386.   }
  387.    return exp;
  388.  
  389.   }
  390.   if (exp->OP_EXP.EXP_OP->Kind == kOP_TIMES) {
  391. # line 304 "IndexShapes.puma"
  392.   {
  393. # line 305 "IndexShapes.puma"
  394.    GetIntConstValue (exp->OP_EXP.OPND1, & found, & val);
  395. # line 306 "IndexShapes.puma"
  396.    if (! (found == true)) goto yyL7;
  397.   {
  398. # line 307 "IndexShapes.puma"
  399.  exp->OP_EXP.OPND1 = MakeConstant (c * val);
  400.   }
  401.   }
  402.    return exp;
  403. yyL7:;
  404.  
  405. # line 311 "IndexShapes.puma"
  406.   {
  407. # line 312 "IndexShapes.puma"
  408.    GetIntConstValue (exp->OP_EXP.OPND2, & found, & val);
  409. # line 313 "IndexShapes.puma"
  410.    if (! (found == true)) goto yyL8;
  411.   {
  412. # line 314 "IndexShapes.puma"
  413.  exp->OP_EXP.OPND2 = MakeConstant (c * val);
  414.   }
  415.   }
  416.    return exp;
  417. yyL8:;
  418.  
  419.   }
  420.   }
  421. # line 318 "IndexShapes.puma"
  422.    return mOP_EXP (mOP_TIMES (), exp, MakeConstant (c));
  423.  
  424. }
  425.  
  426. static tTree DivConstant
  427. # if defined __STDC__ | defined __cplusplus
  428. (register tTree exp, register int c)
  429. # else
  430. (exp, c)
  431.  register tTree exp;
  432.  register int c;
  433. # endif
  434. {
  435. # line 337 "IndexShapes.puma"
  436.  
  437. bool found;
  438. int  val;
  439.  
  440.   if (equalint (c, 0)) {
  441. # line 342 "IndexShapes.puma"
  442.    return MakeConstant (0);
  443.  
  444.   }
  445.   if (equalint (c, 1)) {
  446. # line 346 "IndexShapes.puma"
  447.    return exp;
  448.  
  449.   }
  450. # line 350 "IndexShapes.puma"
  451.   {
  452. # line 351 "IndexShapes.puma"
  453.    if (! ((c < 0))) goto yyL3;
  454.   }
  455.    return MinusExpression (DivConstant (exp, - c));
  456. yyL3:;
  457.  
  458.   if (exp->Kind == kOP_EXP) {
  459.   if (exp->OP_EXP.EXP_OP->Kind == kOP_PLUS) {
  460. # line 355 "IndexShapes.puma"
  461.   {
  462. # line 356 "IndexShapes.puma"
  463.    GetIntConstValue (exp->OP_EXP.OPND2, & found, & val);
  464. # line 357 "IndexShapes.puma"
  465.    if (! ((val % c == 0))) goto yyL4;
  466.   {
  467. # line 358 "IndexShapes.puma"
  468.  exp->OP_EXP.OPND1 = DivConstant (exp->OP_EXP.OPND1, c);
  469.      exp->OP_EXP.OPND2 = MakeConstant (val / c);
  470.  
  471.   }
  472.   }
  473.    return exp;
  474. yyL4:;
  475.  
  476.   }
  477.   if (exp->OP_EXP.EXP_OP->Kind == kOP_MINUS) {
  478. # line 364 "IndexShapes.puma"
  479.   {
  480. # line 365 "IndexShapes.puma"
  481.    GetIntConstValue (exp->OP_EXP.OPND2, & found, & val);
  482. # line 366 "IndexShapes.puma"
  483.    if (! ((val % c == 0))) goto yyL5;
  484.   {
  485. # line 367 "IndexShapes.puma"
  486.  exp->OP_EXP.OPND1 = DivConstant (exp->OP_EXP.OPND1, c);
  487.      exp->OP_EXP.OPND2 = MakeConstant (val / c);
  488.  
  489.   }
  490.   }
  491.    return exp;
  492. yyL5:;
  493.  
  494.   }
  495.   }
  496. # line 373 "IndexShapes.puma"
  497.    return mOP_EXP (mOP_DIVIDE (), exp, MakeConstant (c));
  498.  
  499. }
  500.  
  501. static tTree MinusExpression
  502. # if defined __STDC__ | defined __cplusplus
  503. (register tTree exp)
  504. # else
  505. (exp)
  506.  register tTree exp;
  507. # endif
  508. {
  509. # line 387 "IndexShapes.puma"
  510.  
  511. bool  found;
  512. int   val;
  513. tTree he;
  514.  
  515.   if (exp->Kind == kOP_EXP) {
  516.   if (exp->OP_EXP.EXP_OP->Kind == kOP_MINUS) {
  517. # line 393 "IndexShapes.puma"
  518.   {
  519. # line 394 "IndexShapes.puma"
  520.  he = exp->OP_EXP.OPND1;
  521.      exp->OP_EXP.OPND1 = exp->OP_EXP.OPND2;
  522.      exp->OP_EXP.OPND2 = he;
  523.  
  524.   }
  525.    return exp;
  526.  
  527.   }
  528.   }
  529.   if (exp->Kind == kOP1_EXP) {
  530.   if (exp->OP1_EXP.EXP_OP1->Kind == kOP1_SIGN) {
  531. # line 401 "IndexShapes.puma"
  532.    return exp->OP1_EXP.OPND;
  533.  
  534.   }
  535.   }
  536. # line 405 "IndexShapes.puma"
  537.    return mOP1_EXP (mOP1_SIGN (), exp);
  538.  
  539. }
  540.  
  541. static void GetIncrement
  542. # if defined __STDC__ | defined __cplusplus
  543. (register tTree inc, register bool * found, register int * val)
  544. # else
  545. (inc, found, val)
  546.  register tTree inc;
  547.  register bool * found;
  548.  register int * val;
  549. # endif
  550. {
  551. # line 417 "IndexShapes.puma"
  552.   {
  553. # line 418 "IndexShapes.puma"
  554.    if (! (IsOneIncrement (inc))) goto yyL1;
  555.   }
  556.    * found = true;
  557.    * val = 1;
  558.    return;
  559. yyL1:;
  560.  
  561. # line 421 "IndexShapes.puma"
  562.  {
  563.   bool found1;
  564.   int val1;
  565.   {
  566. # line 423 "IndexShapes.puma"
  567.  
  568. # line 424 "IndexShapes.puma"
  569.  
  570. # line 426 "IndexShapes.puma"
  571.    GetIntConstValue (inc, & found1, & val1);
  572.   }
  573.    * found = found1;
  574.    * val = val1;
  575.    return;
  576.  }
  577.  
  578. ;
  579. }
  580.  
  581. static bool IsOneIncrement
  582. # if defined __STDC__ | defined __cplusplus
  583. (register tTree t)
  584. # else
  585. (t)
  586.  register tTree t;
  587. # endif
  588. {
  589. # line 437 "IndexShapes.puma"
  590.   {
  591. # line 438 "IndexShapes.puma"
  592.    if (! ((t == NoTree))) goto yyL1;
  593.   }
  594.    return true;
  595. yyL1:;
  596.  
  597.   if (t->Kind == kDUMMY_EXP) {
  598. # line 441 "IndexShapes.puma"
  599.    return true;
  600.  
  601.   }
  602.   if (t->Kind == kCONST_EXP) {
  603.   if (t->CONST_EXP.C->Kind == kINT_CONSTANT) {
  604.   if (equalint (t->CONST_EXP.C->INT_CONSTANT.value, 1)) {
  605. # line 444 "IndexShapes.puma"
  606.    return true;
  607.  
  608.   }
  609.   }
  610.   }
  611.   return false;
  612. }
  613.  
  614. tTree NormalArrayIndexes
  615. # if defined __STDC__ | defined __cplusplus
  616. (register tTree t)
  617. # else
  618. (t)
  619.  register tTree t;
  620. # endif
  621. {
  622.  
  623.   switch (t->Kind) {
  624.   case kADDR:
  625. # line 461 "IndexShapes.puma"
  626.   {
  627. # line 462 "IndexShapes.puma"
  628.  t->ADDR.E = NormalArrayIndexes (t->ADDR.E);
  629.   }
  630.    return t;
  631.  
  632.   case kDUMMY_EXP:
  633. # line 466 "IndexShapes.puma"
  634.    return t;
  635.  
  636.   case kCONST_EXP:
  637. # line 470 "IndexShapes.puma"
  638.    return t;
  639.  
  640.   case kARRAY_EXP:
  641. # line 474 "IndexShapes.puma"
  642.   {
  643. # line 475 "IndexShapes.puma"
  644.  t->ARRAY_EXP.ELEMENTS = NormalArrayIndexes (t->ARRAY_EXP.ELEMENTS);
  645.   }
  646.    return t;
  647.  
  648.   case kBTE_LIST:
  649. # line 479 "IndexShapes.puma"
  650.   {
  651. # line 480 "IndexShapes.puma"
  652.  t->BTE_LIST.Elem = NormalArrayIndexes (t->BTE_LIST.Elem);
  653.      t->BTE_LIST.Next = NormalArrayIndexes (t->BTE_LIST.Next);
  654.  
  655.   }
  656.    return t;
  657.  
  658.   case kBTE_EMPTY:
  659. # line 486 "IndexShapes.puma"
  660.    return t;
  661.  
  662.   case kSLICE_EXP:
  663. # line 490 "IndexShapes.puma"
  664.   {
  665. # line 491 "IndexShapes.puma"
  666.  t->SLICE_EXP.START = NormalArrayIndexes (t->SLICE_EXP.START);
  667.      t->SLICE_EXP.STOP  = NormalArrayIndexes (t->SLICE_EXP.STOP );
  668.      t->SLICE_EXP.INC   = NormalArrayIndexes (t->SLICE_EXP.INC  );
  669.  
  670.   }
  671.    return t;
  672.  
  673.   case kOP_EXP:
  674. # line 498 "IndexShapes.puma"
  675.   {
  676. # line 499 "IndexShapes.puma"
  677.  t->OP_EXP.OPND1 = NormalArrayIndexes (t->OP_EXP.OPND1);
  678.      t->OP_EXP.OPND2 = NormalArrayIndexes (t->OP_EXP.OPND2);
  679.  
  680.   }
  681.    return t;
  682.  
  683.   case kOP1_EXP:
  684. # line 505 "IndexShapes.puma"
  685.   {
  686. # line 506 "IndexShapes.puma"
  687.  t->OP1_EXP.OPND = NormalArrayIndexes (t->OP1_EXP.OPND);
  688.   }
  689.    return t;
  690.  
  691.   case kVAR_EXP:
  692. # line 510 "IndexShapes.puma"
  693.   {
  694. # line 511 "IndexShapes.puma"
  695.  t->VAR_EXP.V = NormalArrayIndexes (t->VAR_EXP.V);
  696.   }
  697.    return t;
  698.  
  699.   case kFUNC_CALL_EXP:
  700. # line 515 "IndexShapes.puma"
  701.   {
  702. # line 516 "IndexShapes.puma"
  703.    if (! ((IsIntrFunc (t->FUNC_CALL_EXP.FUNC_ID) == true))) goto yyL11;
  704.   {
  705. # line 517 "IndexShapes.puma"
  706.  t->FUNC_CALL_EXP.FUNC_PARAMS = NormalArrayIndexes (t->FUNC_CALL_EXP.FUNC_PARAMS);
  707.   }
  708.   }
  709.    return t;
  710. yyL11:;
  711.  
  712. # line 521 "IndexShapes.puma"
  713.   {
  714. # line 523 "IndexShapes.puma"
  715.  t->FUNC_CALL_EXP.FUNC_PARAMS = NormalArrayIndexes (t->FUNC_CALL_EXP.FUNC_PARAMS);
  716.   }
  717.    return t;
  718.  
  719.   case kBTP_LIST:
  720. # line 527 "IndexShapes.puma"
  721.   {
  722. # line 528 "IndexShapes.puma"
  723.  t->BTP_LIST.Elem = NormalArrayIndexes (t->BTP_LIST.Elem);
  724.      t->BTP_LIST.Next = NormalArrayIndexes (t->BTP_LIST.Next);
  725.  
  726.   }
  727.    return t;
  728.  
  729.   case kBTP_EMPTY:
  730. # line 534 "IndexShapes.puma"
  731.    return t;
  732.  
  733.   case kVAR_PARAM:
  734.   if (t->VAR_PARAM.V->Kind == kUSED_VAR) {
  735. # line 540 "IndexShapes.puma"
  736.    return t;
  737.  
  738.   }
  739. # line 544 "IndexShapes.puma"
  740.   {
  741. # line 545 "IndexShapes.puma"
  742.  t->VAR_PARAM.V = NormalArrayIndexes (t->VAR_PARAM.V);
  743.   }
  744.    return t;
  745.  
  746.   case kUSED_VAR:
  747. # line 549 "IndexShapes.puma"
  748.   {
  749. # line 550 "IndexShapes.puma"
  750.    if (! ((TreeRank (t) > 0))) goto yyL17;
  751.   }
  752.    return MakeFullShape (t);
  753. yyL17:;
  754.  
  755. # line 554 "IndexShapes.puma"
  756.    return t;
  757.  
  758.   case kLOOP_VAR:
  759. # line 558 "IndexShapes.puma"
  760.    return t;
  761.  
  762.   case kSUBSTRING_VAR:
  763. # line 562 "IndexShapes.puma"
  764.   {
  765. # line 563 "IndexShapes.puma"
  766.  t->SUBSTRING_VAR.IND_EXP = NormalArrayIndexes (t->SUBSTRING_VAR.IND_EXP);
  767.   }
  768.    return t;
  769.  
  770.   case kINDEXED_VAR:
  771. # line 567 "IndexShapes.puma"
  772.   {
  773. # line 568 "IndexShapes.puma"
  774.  t->INDEXED_VAR.IND_EXPS = NormalArrayIndexes (t->INDEXED_VAR.IND_EXPS);
  775.   }
  776.    return MakeFullShape (t);
  777.  
  778.   }
  779.  
  780. # line 572 "IndexShapes.puma"
  781.   {
  782. # line 573 "IndexShapes.puma"
  783.    failure_protocol ("IndexShapes", "NormalArrayIndexes", t);
  784.   }
  785.    return t;
  786.  
  787. }
  788.  
  789. void BeginIndexShapes ()
  790. {
  791. }
  792.  
  793. void CloseIndexShapes ()
  794. {
  795. }
  796.